package com.lvcoding.auth2.jdbc.jwt.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuyanshen
 * @description 密码加密类
 * @date 2022-02-18 下午6:05
 */
@RequestMapping("pwd")
@RestController
public class EncodePasswordController {

    @Autowired
    private PasswordEncoder passwordEncoder;

    @GetMapping("encode/{pwd}")
    public String encode(@PathVariable("pwd") String pwd) {
        return passwordEncoder.encode(pwd);
    }
}
